﻿<bobasoft:WindowBase
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:bobasoft="http://schemas.bobasoft.com/xaml"
        xmlns:local="clr-namespace:Bobasoft.Example.WPF" xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" x:Class="Bobasoft.Example.WPF.MainWindow"
        mc:Ignorable="d"
        Title="MainWindow" Height="506" Width="681">
	<bobasoft:WindowBase.Resources>
		<ResourceDictionary>
			<local:MainWindowModel x:Key="Model" d:IsDataSource="True"/>
		</ResourceDictionary>
	</bobasoft:WindowBase.Resources>
	<Grid d:DataContext="{StaticResource Model}">
		<Grid.RowDefinitions>
			<RowDefinition Height="0.306*"/>
			<RowDefinition Height="0.359*"/>
			<RowDefinition Height="0.335*"/>
		</Grid.RowDefinitions>
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="0.346*"/>
			<ColumnDefinition Width="0.287*"/>
			<ColumnDefinition Width="0.367*"/>
		</Grid.ColumnDefinitions>
		<Border BorderThickness="1" BorderBrush="Black">
			<Grid>
				<TextBlock TextWrapping="Wrap" Text="{Binding Values[text].Value}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
				<TextBlock Height="16" Margin="0,8,0,0" TextWrapping="Wrap" Text="simple value binding" VerticalAlignment="Top" FontWeight="Bold" Foreground="#FF00A4E9" HorizontalAlignment="Center"/>
        
			</Grid>
        
		</Border>
		<Border BorderThickness="1" BorderBrush="Black" Grid.Column="1">
			<Grid>
				<ListBox x:Name="listBox" ItemsSource="{Binding List}" Margin="0,59,0,0" HorizontalAlignment="Center">
					<i:Interaction.Triggers>
						<i:EventTrigger EventName="SelectionChanged">
							<i:InvokeCommandAction Command="{Binding Events[list.onselectionchanged]}" CommandParameter="{Binding SelectedIndex, ElementName=listBox}"/>
						</i:EventTrigger>
					</i:Interaction.Triggers>
				</ListBox>
				<TextBlock Text="{Binding Values[list.selectedindex].Value}" TextWrapping="Wrap" VerticalAlignment="Top" HorizontalAlignment="Center" Margin="0,39.04,0,0"/>
				<TextBlock Height="16" Margin="0,5.04,0,0" TextWrapping="Wrap" Text="listbox event bindings" VerticalAlignment="Top" FontWeight="Bold" Foreground="#FF00A4E9" HorizontalAlignment="Center"/>
			</Grid>
		</Border>
		<Border BorderThickness="1" BorderBrush="Black" Margin="0" Grid.Row="1">
			<Grid>
				<TextBlock Height="16" Margin="0,5.04,0,0" TextWrapping="Wrap" Text="command binding" VerticalAlignment="Top" FontWeight="Bold" Foreground="#FF00A4E9" HorizontalAlignment="Center"/>
				<Button DataContext="{Binding Commands[grid.do_changevisibility]}" Command="{Binding}" Content="{Binding Text}" Margin="46,76,53.114,64.016" />
			</Grid>
		</Border>
		<Border BorderThickness="1" BorderBrush="Black" Grid.Row="1" Grid.Column="1">
			<Grid>
				<TextBlock Height="16" Margin="0,5.04,0,0" TextWrapping="Wrap" Text="visibility converter" VerticalAlignment="Top" FontWeight="Bold" Foreground="#FF00A4E9" HorizontalAlignment="Center"/>
				<Grid Margin="8,50,8,18.976" Background="#FF626262" Visibility="{Binding Values[grid.isvisible].Value, ConverterParameter=true, Converter={StaticResource visibilityConverter}}">
					<TextBlock Margin="0" TextWrapping="Wrap" VerticalAlignment="Center" d:LayoutOverrides="Width" HorizontalAlignment="Center"><Run Text="Grid should hide when Values[grid.isvisible].Value == true"/></TextBlock>
				</Grid>
			</Grid>
		</Border>
		<Border BorderThickness="1" BorderBrush="Black" Grid.Row="1" Grid.Column="2">
			<Grid>
				<TextBlock Height="16" Margin="0,5.04,0,0" TextWrapping="Wrap" Text="visibility converter" VerticalAlignment="Top" FontWeight="Bold" Foreground="#FF00A4E9" HorizontalAlignment="Center"/>
				<Grid Margin="8,50,8,18.976" Background="#FF626262" Visibility="{Binding Values[text.input].Value, ConverterParameter=helloworld, Converter={StaticResource visibilityConverter}}">
					<TextBlock Margin="0" TextWrapping="Wrap" VerticalAlignment="Center" d:LayoutOverrides="Width" HorizontalAlignment="Center" Text="Grid should showup when in textbox text will be equals to 'helloworld'"/>
				</Grid>
			</Grid>
		</Border>
		<Border BorderThickness="1" BorderBrush="Black" Grid.Column="2" Margin="0">
			<Grid>
				<TextBlock Height="16" Margin="0,5.04,0,0" TextWrapping="Wrap" Text="textbox binding" VerticalAlignment="Top" FontWeight="Bold" Foreground="#FF00A4E9" HorizontalAlignment="Center"/>
				<TextBlock Margin="29.055,59,101,63.024" TextWrapping="Wrap" Text="{Binding Values[text.input].Value}"/>
				<TextBox Height="22" Margin="29.055,0,75.621,37.024" TextWrapping="Wrap" Text="{Binding Values[text.input].Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Bottom"/>
				<TextBlock Height="16" Margin="0,25.04,0,0" TextWrapping="Wrap" Text="input 'helloworld' to textbox" VerticalAlignment="Top" Foreground="#FF727272" FontStyle="Italic" HorizontalAlignment="Center"/>
			</Grid>
		</Border>
		<Border BorderThickness="1" BorderBrush="Black" Grid.Row="2">
			<Grid>
				<TextBlock Height="16" Margin="0,5.04,0,0" TextWrapping="Wrap" Text="enum converter" VerticalAlignment="Top" FontWeight="Bold" Foreground="#FF00A4E9" HorizontalAlignment="Center"/>
				<ComboBox Margin="39,72.78,34.09,57" ItemsSource="{Binding EnumValue, ConverterParameter=array, Converter={StaticResource enumConverter}}" SelectedValue="{Binding EnumValue, Converter={StaticResource enumConverter}}"/>
			</Grid>
		</Border>
        
	</Grid>
</bobasoft:WindowBase>
